{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=3176
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,j,x,y,kk:longint;
	a:array[-10..10,-10..10] of byte;
	f:boolean;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
fillchar(a,sizeof(a),0);
f:=false;
for kk:=1 to 8 do begin
	read(x,y);
	a[x][y]:=2;
	for j:=1 to 8 do
		if (a[x][j]=2) and (j<>y) then begin
			f:=true;
			break;
		end;
	for j:=1 to 8 do
		if (a[j][y]=2) and (j<>x) then begin
			f:=true;
			break;
		end;
	i:=x;
	j:=y;
	while (j<8) and (i<8) do begin
		inc(i);
		inc(j);
	end;
	while (i>0) and (j>0) do begin
		if (i<>x) and (a[i][j]=2) then begin
			f:=true;
			break;
		end;
		dec(i);
		dec(j);
	end;
	i:=x;
	j:=y;
	while (i<8) and (j>1) do begin
		inc(i);
		dec(j);
	end;
	while (i>0) and (j<9) do begin
		if (i<>x) and (a[i][j]=2) then begin
			f:=true;
			break;
		end;
		dec(i);
		inc(j);
	end;
	if f then break;
end;
if f then write('YES') else write('NO');
end.